org.eclipse.vtp.framework.engine.support
Class ActionContextWrapper

java.lang.Object
  extended by org.eclipse.vtp.framework.engine.support.ActionContextWrapper
All Implemented Interfaces:
IActionContext, IContext, IExecutionContext, ILogger, IProcessContext, IReporter, ISessionContext

public abstract class ActionContextWrapper
extends java.lang.Object
implements IActionContext

A wrapper for the IActionContext interface.

Author:
Lonnie Pryor

Field Summary
 
Fields inherited from interface org.eclipse.vtp.framework.core.IActionContext
STATE_AFTER, STATE_BEFORE, STATE_DURING
 
Fields inherited from interface org.eclipse.vtp.framework.core.IReporter
SEVERITY_DEBUG, SEVERITY_ERROR, SEVERITY_INFO, SEVERITY_WARN
 
Constructor Summary
protected ActionContextWrapper()
          Creates a new ActionContextWrapper.
 
Method Summary
 void clearAttribute(java.lang.String attributeName)
          Clears the value of a session-level attribute.
 void clearParameter(java.lang.String parameterName)
          Clears the value of the execution-level parameter with the specified name.
 IActionResult createResult(java.lang.String resultName)
          Creates an action result with the specified name.
 IActionResult createResult(java.lang.String resultName, java.lang.Throwable failureCause)
          Creates an action result with the specified name.
 void debug(java.lang.String message)
          Creates and publishes a debug log entry with the specified attributes.
 void debug(java.lang.String[] categories, java.lang.String message)
          Creates and publishes a debug log entry with the specified attributes.
 void debug(java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a debug log entry with the specified attributes.
 void debug(java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a debug log entry with the specified attributes.
 void error(java.lang.String message)
          Creates and publishes an error log entry with the specified attributes.
 void error(java.lang.String[] categories, java.lang.String message)
          Creates and publishes an error log entry with the specified attributes.
 void error(java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes an error log entry with the specified attributes.
 void error(java.lang.String message, java.util.Dictionary properties)
          Creates and publishes an error log entry with the specified attributes.
protected abstract  IActionContext getActionContext()
          Returns the wrapped action context.
 java.lang.String getActionID()
          Returns the ID of the current action.
 java.lang.String getActionName()
          Returns the name of the current action.
 int getActionState()
          Returns the state of the current action.
 java.lang.Object getAttribute(java.lang.String attributeName)
          Returns the value of a session-level attribute with the specified name or null if no such attribute exists.
 java.lang.String[] getAttributeNames()
          Returns the names of all the session-level attributes currently registered.
 java.lang.String getExecutionID()
          Returns the ID of this execution.
 java.lang.String getParameter(java.lang.String parameterName)
          Returns the value of the execution-level parameter with the specified name or null if no such parameter exists.
 java.lang.String[] getParameterNames()
          Returns the names of the parameters available to the execution sequence.
 java.lang.String[] getParameters(java.lang.String parameterName)
          Returns the values of the execution-level parameter with the specified name or null if no such parameter exists.
 java.lang.String getProcessID()
          Returns the ID of this process.
 java.lang.Object getProperty(java.lang.String propertyName)
          Returns the value of the process-level configuration property with the specified name or null if no such property exists.
 java.lang.String getSessionID()
          Returns the ID of the current session.
 void info(java.lang.String message)
          Creates and publishes an informational log entry with the specified attributes.
 void info(java.lang.String[] categories, java.lang.String message)
          Creates and publishes an informational log entry with the specified attributes.
 void info(java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes an informational log entry with the specified attributes.
 void info(java.lang.String message, java.util.Dictionary properties)
          Creates and publishes an informational log entry with the specified attributes.
 boolean isDebugEnabled()
          Returns true if the debug severity level is enabled.
 boolean isErrorEnabled()
          Returns true if the error severity level is enabled.
 boolean isInfoEnabled()
          Returns true if the informational severity level is enabled.
protected  boolean isReservedIdentifier(java.lang.String identifier)
          Returns true if the specified identifier is implemented by the context.
 boolean isSeverityEnabled(int severity)
          Returns true if the specified severity level is enabled.
 boolean isWarnEnabled()
          Returns true if the warning severity level is enabled.
 java.lang.Class loadClass(java.lang.String className)
          Loads a class visible to the process.
 void log(int severity, java.lang.String message)
          Creates and publishes a log entry with the specified attributes.
 void log(int severity, java.lang.String[] categories, java.lang.String message)
          Creates and publishes a log entry with the specified attributes.
 void log(int severity, java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a log entry with the specified attributes.
 void log(int severity, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a log entry with the specified attributes.
 java.lang.Object lookup(java.lang.String identifier)
          Looks up the service selected for the specified identifier or null if no such service exists.
 java.lang.Object[] lookupAll(java.lang.String identifier)
          Returns an array containing all the services registered under the specified identifier.
 void report(int severity, java.lang.String message)
          Creates and publishes a reporting entry with the specified attributes.
 void report(int severity, java.lang.String[] categories, java.lang.String message)
          Creates and publishes a reporting entry with the specified attributes.
 void report(int severity, java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a reporting entry with the specified attributes.
 void report(int severity, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a reporting entry with the specified attributes.
 void setAttribute(java.lang.String attributeName, java.lang.Object attributeValue)
          Sets the value of a session-level attribute or clears it if the supplied value is null.
 void setParameter(java.lang.String parameterName, java.lang.String value)
          Sets the value of the execution-level parameter with the specified name or clears it if the value is null.
 void setParameters(java.lang.String parameterName, java.lang.String[] values)
          Sets the values of the execution-level parameter with the specified name or clears them if the value is null or empty.
 void warn(java.lang.String message)
          Creates and publishes a warning log entry with the specified attributes.
 void warn(java.lang.String[] categories, java.lang.String message)
          Creates and publishes a warning log entry with the specified attributes.
 void warn(java.lang.String[] categories, java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a warning log entry with the specified attributes.
 void warn(java.lang.String message, java.util.Dictionary properties)
          Creates and publishes a warning log entry with the specified attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionContextWrapper

protected ActionContextWrapper()
Creates a new ActionContextWrapper.

Method Detail

isReservedIdentifier

protected boolean isReservedIdentifier(java.lang.String identifier)
Returns true if the specified identifier is implemented by the context.

Parameters:
identifier - The identifier to check.
Returns:
True if the specified identifier is implemented by the context.

getActionContext

protected abstract IActionContext getActionContext()
Returns the wrapped action context.

Returns:
The wrapped action context.

isSeverityEnabled

public boolean isSeverityEnabled(int severity)
Description copied from interface: IReporter
Returns true if the specified severity level is enabled.

Specified by:
isSeverityEnabled in interface IReporter
Parameters:
severity - The severity to check.
Returns:
True if the specified severity level is enabled.

report

public void report(int severity,
                   java.lang.String message)
Description copied from interface: IReporter
Creates and publishes a reporting entry with the specified attributes.

Specified by:
report in interface IReporter
Parameters:
severity - The severity of the report.
message - The message associated with the report or null to not include a message.

report

public void report(int severity,
                   java.lang.String message,
                   java.util.Dictionary properties)
Description copied from interface: IReporter
Creates and publishes a reporting entry with the specified attributes.

Specified by:
report in interface IReporter
Parameters:
severity - The severity of the report.
message - The message associated with the report or null to not include a message.
properties - The properties of the report or null if no properties are specified.

report

public void report(int severity,
                   java.lang.String[] categories,
                   java.lang.String message)
Description copied from interface: IReporter
Creates and publishes a reporting entry with the specified attributes.

Specified by:
report in interface IReporter
Parameters:
severity - The severity of the report.
categories - The categories the report pertains to or null if no catagories are related.
message - The message associated with the report or null to not include a message.

report

public void report(int severity,
                   java.lang.String[] categories,
                   java.lang.String message,
                   java.util.Dictionary properties)
Description copied from interface: IReporter
Creates and publishes a reporting entry with the specified attributes.

Specified by:
report in interface IReporter
Parameters:
severity - The severity of the report.
categories - The categories the report pertains to or null if no catagories are related.
message - The message associated with the report or null to not include a message.
properties - The properties of the report or null if no properties are specified.

log

public void log(int severity,
                java.lang.String message)
Description copied from interface: ILogger
Creates and publishes a log entry with the specified attributes.

Specified by:
log in interface ILogger
Parameters:
severity - The severity of the log entry.
message - The message associated with the log entry or null to not include a message.

log

public void log(int severity,
                java.lang.String message,
                java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes a log entry with the specified attributes.

Specified by:
log in interface ILogger
Parameters:
severity - The severity of the log entry.
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

log

public void log(int severity,
                java.lang.String[] categories,
                java.lang.String message)
Description copied from interface: ILogger
Creates and publishes a log entry with the specified attributes.

Specified by:
log in interface ILogger
Parameters:
severity - The severity of the log entry.
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.

log

public void log(int severity,
                java.lang.String[] categories,
                java.lang.String message,
                java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes a log entry with the specified attributes.

Specified by:
log in interface ILogger
Parameters:
severity - The severity of the log entry.
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

isErrorEnabled

public boolean isErrorEnabled()
Description copied from interface: ILogger
Returns true if the error severity level is enabled.

Specified by:
isErrorEnabled in interface ILogger
Returns:
True if the error severity level is enabled.

error

public void error(java.lang.String message)
Description copied from interface: ILogger
Creates and publishes an error log entry with the specified attributes.

Specified by:
error in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.

error

public void error(java.lang.String message,
                  java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes an error log entry with the specified attributes.

Specified by:
error in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

error

public void error(java.lang.String[] categories,
                  java.lang.String message)
Description copied from interface: ILogger
Creates and publishes an error log entry with the specified attributes.

Specified by:
error in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.

error

public void error(java.lang.String[] categories,
                  java.lang.String message,
                  java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes an error log entry with the specified attributes.

Specified by:
error in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

isWarnEnabled

public boolean isWarnEnabled()
Description copied from interface: ILogger
Returns true if the warning severity level is enabled.

Specified by:
isWarnEnabled in interface ILogger
Returns:
True if the warning severity level is enabled.

warn

public void warn(java.lang.String message)
Description copied from interface: ILogger
Creates and publishes a warning log entry with the specified attributes.

Specified by:
warn in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.

warn

public void warn(java.lang.String message,
                 java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes a warning log entry with the specified attributes.

Specified by:
warn in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

warn

public void warn(java.lang.String[] categories,
                 java.lang.String message)
Description copied from interface: ILogger
Creates and publishes a warning log entry with the specified attributes.

Specified by:
warn in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.

warn

public void warn(java.lang.String[] categories,
                 java.lang.String message,
                 java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes a warning log entry with the specified attributes.

Specified by:
warn in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

isInfoEnabled

public boolean isInfoEnabled()
Description copied from interface: ILogger
Returns true if the informational severity level is enabled.

Specified by:
isInfoEnabled in interface ILogger
Returns:
True if the informational severity level is enabled.

info

public void info(java.lang.String message)
Description copied from interface: ILogger
Creates and publishes an informational log entry with the specified attributes.

Specified by:
info in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.

info

public void info(java.lang.String message,
                 java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes an informational log entry with the specified attributes.

Specified by:
info in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

info

public void info(java.lang.String[] categories,
                 java.lang.String message)
Description copied from interface: ILogger
Creates and publishes an informational log entry with the specified attributes.

Specified by:
info in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.

info

public void info(java.lang.String[] categories,
                 java.lang.String message,
                 java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes an informational log entry with the specified attributes.

Specified by:
info in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

isDebugEnabled

public boolean isDebugEnabled()
Description copied from interface: ILogger
Returns true if the debug severity level is enabled.

Specified by:
isDebugEnabled in interface ILogger
Returns:
True if the debug severity level is enabled.

debug

public void debug(java.lang.String message)
Description copied from interface: ILogger
Creates and publishes a debug log entry with the specified attributes.

Specified by:
debug in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.

debug

public void debug(java.lang.String message,
                  java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes a debug log entry with the specified attributes.

Specified by:
debug in interface ILogger
Parameters:
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

debug

public void debug(java.lang.String[] categories,
                  java.lang.String message)
Description copied from interface: ILogger
Creates and publishes a debug log entry with the specified attributes.

Specified by:
debug in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.

debug

public void debug(java.lang.String[] categories,
                  java.lang.String message,
                  java.util.Dictionary properties)
Description copied from interface: ILogger
Creates and publishes a debug log entry with the specified attributes.

Specified by:
debug in interface ILogger
Parameters:
categories - The categories the log entry pertains to or null if no catagories are related.
message - The message associated with the log entry or null to not include a message.
properties - The properties of the log entry or null if no properties are specified.

lookup

public java.lang.Object lookup(java.lang.String identifier)
                        throws java.lang.NullPointerException
Description copied from interface: IContext
Looks up the service selected for the specified identifier or null if no such service exists.

Specified by:
lookup in interface IContext
Parameters:
identifier - The identifier of the service to look up.
Returns:
The service selected for the specified identifier or null if no such service exists.
Throws:
java.lang.NullPointerException - If the supplied identifier is null.

lookupAll

public java.lang.Object[] lookupAll(java.lang.String identifier)
                             throws java.lang.NullPointerException
Description copied from interface: IContext
Returns an array containing all the services registered under the specified identifier.

Specified by:
lookupAll in interface IContext
Parameters:
identifier - The identifier of the services to look up.
Returns:
An array containing all the services registered under the specified identifier.
Throws:
java.lang.NullPointerException - If the supplied identifier is null.

getProcessID

public java.lang.String getProcessID()
Description copied from interface: IProcessContext
Returns the ID of this process.

Specified by:
getProcessID in interface IProcessContext
Returns:
The ID of this process.

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
                             throws java.lang.NullPointerException
Description copied from interface: IProcessContext
Returns the value of the process-level configuration property with the specified name or null if no such property exists.

Specified by:
getProperty in interface IProcessContext
Parameters:
propertyName - The name of the configuration property to return.
Returns:
The value of the process-level configuration property with the specified name or null if no such property exists.
Throws:
java.lang.NullPointerException - If the supplied property name is null.

loadClass

public java.lang.Class loadClass(java.lang.String className)
                          throws java.lang.ClassNotFoundException,
                                 java.lang.NullPointerException
Description copied from interface: IProcessContext
Loads a class visible to the process.

Specified by:
loadClass in interface IProcessContext
Parameters:
className - The name of the class to load.
Returns:
The requested class instance.
Throws:
java.lang.ClassNotFoundException - If a class with the specified name cannot be found.
java.lang.NullPointerException - If the supplied class name is null.

getSessionID

public java.lang.String getSessionID()
Description copied from interface: ISessionContext
Returns the ID of the current session.

Specified by:
getSessionID in interface ISessionContext
Returns:
The ID of the current session.

getAttributeNames

public java.lang.String[] getAttributeNames()
Description copied from interface: ISessionContext
Returns the names of all the session-level attributes currently registered.

Specified by:
getAttributeNames in interface ISessionContext
Returns:
The names of all the session-level attributes currently registered.

getAttribute

public java.lang.Object getAttribute(java.lang.String attributeName)
                              throws java.lang.NullPointerException
Description copied from interface: ISessionContext
Returns the value of a session-level attribute with the specified name or null if no such attribute exists.

Specified by:
getAttribute in interface ISessionContext
Parameters:
attributeName - The name of the session attribute to return.
Returns:
The value of a session-level attribute with the specified name or null if no such attribute exists.
Throws:
java.lang.NullPointerException - If the supplied attribute name is null.

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.Object attributeValue)
                  throws java.lang.NullPointerException
Description copied from interface: ISessionContext
Sets the value of a session-level attribute or clears it if the supplied value is null.

Specified by:
setAttribute in interface ISessionContext
Parameters:
attributeName - The name of the session attribute to set.
attributeValue - The value to set the attribute to or null to clear the attribute.
Throws:
java.lang.NullPointerException - If the supplied attribute name is null.

clearAttribute

public void clearAttribute(java.lang.String attributeName)
                    throws java.lang.NullPointerException
Description copied from interface: ISessionContext
Clears the value of a session-level attribute.

Specified by:
clearAttribute in interface ISessionContext
Parameters:
attributeName - The name of the session attribute to clear.
Throws:
java.lang.NullPointerException - If the supplied attribute name is null.

getExecutionID

public java.lang.String getExecutionID()
Description copied from interface: IExecutionContext
Returns the ID of this execution.

Specified by:
getExecutionID in interface IExecutionContext
Returns:
The ID of this execution.

getParameterNames

public java.lang.String[] getParameterNames()
Description copied from interface: IExecutionContext
Returns the names of the parameters available to the execution sequence.

Specified by:
getParameterNames in interface IExecutionContext
Returns:
The names of the parameters available to the execution sequence.

getParameter

public java.lang.String getParameter(java.lang.String parameterName)
                              throws java.lang.NullPointerException
Description copied from interface: IExecutionContext
Returns the value of the execution-level parameter with the specified name or null if no such parameter exists.

Specified by:
getParameter in interface IExecutionContext
Parameters:
parameterName - The name of the parameter to return.
Returns:
The value of the execution-level parameter with the specified name or null if no such parameter exists.
Throws:
java.lang.NullPointerException - If the supplied parameter name is null.

getParameters

public java.lang.String[] getParameters(java.lang.String parameterName)
                                 throws java.lang.NullPointerException
Description copied from interface: IExecutionContext
Returns the values of the execution-level parameter with the specified name or null if no such parameter exists.

Specified by:
getParameters in interface IExecutionContext
Parameters:
parameterName - The name of the parameter to return.
Returns:
The values of the execution-level parameter with the specified name or null if no such parameter exists.
Throws:
java.lang.NullPointerException - If the supplied parameter name is null.

setParameter

public void setParameter(java.lang.String parameterName,
                         java.lang.String value)
                  throws java.lang.NullPointerException
Description copied from interface: IExecutionContext
Sets the value of the execution-level parameter with the specified name or clears it if the value is null.

Specified by:
setParameter in interface IExecutionContext
Parameters:
parameterName - The name of the parameter to set.
value - The value of the execution-level parameter with the specified name or null to clear the value.
Throws:
java.lang.NullPointerException - If the supplied parameter name is null.

setParameters

public void setParameters(java.lang.String parameterName,
                          java.lang.String[] values)
                   throws java.lang.NullPointerException
Description copied from interface: IExecutionContext
Sets the values of the execution-level parameter with the specified name or clears them if the value is null or empty.

Specified by:
setParameters in interface IExecutionContext
Parameters:
parameterName - The name of the parameters to set.
values - The values of the execution-level parameter with the specified name or null or to clear the values.
Throws:
java.lang.NullPointerException - If the supplied parameter name is null.

clearParameter

public void clearParameter(java.lang.String parameterName)
                    throws java.lang.NullPointerException
Description copied from interface: IExecutionContext
Clears the value of the execution-level parameter with the specified name.

Specified by:
clearParameter in interface IExecutionContext
Parameters:
parameterName - The name of the parameter to clear.
Throws:
java.lang.NullPointerException - If the supplied parameter name is null.

getActionID

public java.lang.String getActionID()
Description copied from interface: IActionContext
Returns the ID of the current action.

Specified by:
getActionID in interface IActionContext
Returns:
The ID of the current action.

getActionName

public java.lang.String getActionName()
Description copied from interface: IActionContext
Returns the name of the current action.

Specified by:
getActionName in interface IActionContext
Returns:
The name of the current action.

getActionState

public int getActionState()
Description copied from interface: IActionContext
Returns the state of the current action.

Specified by:
getActionState in interface IActionContext
Returns:
The state of the current action.

createResult

public IActionResult createResult(java.lang.String resultName)
Description copied from interface: IActionContext
Creates an action result with the specified name.

Specified by:
createResult in interface IActionContext
Parameters:
resultName - The name of the result to create or null to create an undefined result.
Returns:
A new action result with the specified name.

createResult

public IActionResult createResult(java.lang.String resultName,
                                  java.lang.Throwable failureCause)
Description copied from interface: IActionContext
Creates an action result with the specified name.

Specified by:
createResult in interface IActionContext
Parameters:
resultName - The name of the result to create or null to create an undefined result.
failureCause - The cause of the failure the action result represents or null to not specify a failure cause.
Returns:
A new action result with the specified name and failure cause.